<?php
/**
 * 专题活动参与用户
 */

namespace App\Models\Act;

use Illuminate\Database\Eloquent\Model;

class Join extends Model
{
	protected $table = 'act_joins';

    protected $guarded = array();

    

    protected $with = ['question','answer'];
    /**
     * Undocumented function
     *
     * @return void
     */
    public function topic()
    {
        return $this->belongsTo('\App\Models\Act\Topic');
    }

    public function answer()
    {
        return $this->hasOne('\App\Models\Act\Answer');
    }

    public function question()
    {
        return $this->hasOneThrough('\App\Models\Act\Question', '\App\Models\Act\Answer','join_id','id','id','question_id');
    }
    
}